﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PatentEn.aspx.cs" Inherits="Patent.Web.PatentEn" %>

<%@ Register Src="Control/Pager.ascx" TagName="Pager" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="CSS/common.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        #header
        {
            margin: auto;
            margin-top: 10px;
            width: 980px;
        }
        #header div
        {
            margin: 5px auto 5px auto;
            width: 300px;
            text-align: left;
        }
        #header .style1
        {
            text-align: center;
        }
        #list
        {
            margin: auto;
            width: 980px;
        }
        #list table tr td
        {
            text-align: left;
        }
        body
        {
            text-align: center;
        }
    </style>

    <script type="text/javascript">
        function chk_click(sender, id)
        {
            var hidIDs = document.getElementById("ID");
            if (sender.checked)
            {
                if (hidIDs.value == "")
                {

                    hidIDs.value = ",";
                }
                hidIDs.value = hidIDs.value + id + ",";
            }
            else
            {
                hidIDs.value = hidIDs.value.replace("," + id + ",", ",");
                if (hidIDs.value == ",")
                {
                    hidIDs.value = "";
                }
            }
        }

        function selectAll(sender)
        {
            var chks = document.getElementById("list").getElementsByTagName("input");
            for (var i = 0; i < chks.length; i++)
            {
                if (chks[i].type == "checkbox")
                {
                    if (chks[i].checked != sender.checked)
                    {
                        chks[i].click();
                    }
                }
            }

        }

        function validate()
        {
            if (document.getElementById("ID").value == "")
            {
                alert("请选择记录");
                return false;
            }
            return true;
        }


        function showDetail()
        {
            var ids = document.getElementById("ID").value;
            if (ids == "")
            {
                alert("请选择专利");
                return;
            }

            var url = "PatentEnDetail.aspx?ID=" + ids;
            window.open(url);
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div id="header">
        <div>
            <asp:DropDownList ID="drpField1" runat="server">
            </asp:DropDownList>
            <asp:TextBox ID="txtCondition1" runat="server"></asp:TextBox>
            <asp:DropDownList ID="drpLogic" runat="server">
            </asp:DropDownList>
        </div>
        <div>
            <asp:DropDownList ID="drpField2" runat="server">
            </asp:DropDownList>
            <asp:TextBox ID="txtCondition2" runat="server"></asp:TextBox>
        </div>
        <div class="style1">
            <asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" Text="查询" Width="100px" />&nbsp;<asp:Button 
                ID="btnStatistic" runat="server" PostBackUrl="PatentEnStatistic.aspx" 
                Text="统计" onclick="btnStatistic_Click" /><asp:HiddenField ID="hidCondition" runat="server" />
            &nbsp;<a href="default.aspx">转到中文</a>
        </div>
    </div>
    <input type="hidden" id="ID" name="ID" />
    <div id="list">
        <table border="0" cellpadding="0" cellspacing="0" width="100%">
            <tr>
                <th style="width: 50px;">
                    <input id="Checkbox1" type="checkbox" onclick="selectAll(this)" />
                </th>
                <th>
                    PN
                </th>
                <th>
                    TI
                </th>
                <th>
                    AU
                </th>
                <th style="border-right-width: 0px;">
                    查看
                </th>
            </tr>
            <asp:ListView ID="lv" runat="server" ItemPlaceholderID="items">
                <LayoutTemplate>
                    <tr id="items" runat="server">
                    </tr>
                </LayoutTemplate>
                <ItemTemplate>
                    <tr>
                        <td style="width: 50px;">
                            <input id="Checkbox1" type="checkbox" onclick="chk_click(this,'<%#Eval("ID") %>');" />
                        </td>
                        <td>
                            <%#Eval("PN")%>
                        </td>
                        <td>
                            <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%#"PatentEnDetail.aspx?ID=" + Eval("ID") %>'><%#Eval("TI")%></asp:HyperLink>
                        </td>
                        <td>
                            <%#Eval("AU") %>
                        </td>
                        <td>
                            <asp:HyperLink ID="HyperLink3" runat="server" NavigateUrl='<%#"PatentEnDetail.aspx?ID=" + Eval("ID") %>'>详细</asp:HyperLink>
                        </td>
                    </tr>
                </ItemTemplate>
                <EmptyDataTemplate>
                    <tr>
                        <td style="text-align: center;" colspan="5">
                            没有数据
                        </td>
                    </tr>
                </EmptyDataTemplate>
            </asp:ListView>
        </table>
        <uc1:Pager ID="Pager1" runat="server" Visible="false" PostbackUrl="PatentEnDetail.aspx" />
    </div>
    </form>
</body>
</html>
